CIDR VLSM AS รศ.ดร. อน นต ผลเพ ม Asso. Prof. Anan Phonphoem, Ph.D. anan.p@ku.ac.th http://www.cpe.ku.ac.th/~anan Computer Engineering Department Kasetsart University, Bangkok, Thailand 1
Outline Classless Interdomain Routing (CIDR) Variable Length Subnet Mask (VLSM) Autonomous System (AS) 2
IP Addresses Revisited Potential exhaustion of IPv4 address space (due to inefficiency) Class B is too big Class C is too small (many are available) Growth of back bone routing tables Lots of small networks causes large routing tables Route calculation and management requires high computational overhead 3
Classless InterDomain Routing (CIDR) Try to balance two competing effects Address utilization Router complexity CIDR allows routers to break the rigid interpretation of IP address structures Also called Supernet Opposite of Subnet 4
Classful & Classless addressing A B C Classful 128 networks x 16M hosts 16K networks x 64K hosts 2M networks x 256 hosts Obsolete inefficient depletion of B space too many routes from C space Classless Hosts Prefix Classful 2 /31 4 /30 8 /29 16 /28 32 /27 64 /26 128 /25 256 /24...... 1 C... 4096 /20 16 C 8192 /19 32 C 16384 /18 64 C 32768 /17 128 C 65536 /16 1 B......... Best Current Practice 5
Prefix Length 6
CIDR Example What is the first address in the block if one of the addresses is 167.199.170.82/27? Solution Address in binary: 10100111 11000111 10101010 01010010 Keep the left 27 bits: 10100111 11000111 10101010 01000000 Result in CIDR notation: 167.199.170.64/27 7
Supernetting: CIDR Enable network number to be any length (No Class) Collapse multiple addresses assigned to a single AS to one address All routers must understand CIDR addressing Need both Address and Mask (prefix and suffix) Slash notation (123.10.16.0 /20) Some prefixes are reserved for private add. 10/8, 172.16/12, 192.168/16, 169.254/16 These are not routable in the Internet 8
Example of CIDR Consider an ISP providing IP connection to a number of private companies If IP addresses for companies are carefully selected a border router needs only advertise one aggregated route for all companies Company A Advertise Route Company B ISP Company C 9
Example of CIDR (Supernetting) If ISP needs 16 class C addresses make them contiguous Eg. 199.23.16.0 to 199.23.31.0 enables a 20-bit network number 199.23.0001 0000.0 199.23.16.0 199.23.0001 0001.0 199.23.17.0 199.23.0001 0010.0 199.23.18.0 199.23.0001 0011.0 199.23.19.0 199.23.0001 1111.0 199.23.31.0 10
Example of CIDR Without CIDR 199.23.16.0 199.23.17.0 199.23.31.0 199.23.16.0 199.23.17.0 With CIDR 199.23.16.0/20 Boarder Gateway 199.23.31.0 11
Aggregation Some pairs of consecutive prefixes Example: routes within the same AS: AS has 2 address blocks: 1.2.2.0/24 = 0000001.00000010.00000010.00000000/24 1.2.3.0/24 = 0000001.00000010.00000011.00000000/24 Can announce 1.2.2.0/23 12
CIDR: Longest prefix match Because prefixes of arbitrary length allowed, overlapping prefixes can exist. Example: router hears 124.39.0.0/16 from one neighbor and 124.39.11.0/24 from another neighbor 124.39.11.32 124.39.22.45 124.39.0.0/16 124.39.11.0/24 Router forwards packet according to most specific forwarding information, called longest prefix match Packet with destination 124.39.11.32 will be forwarded using /24 entry. Packet with destination 124.39.22.45 will be forwarded using /16 entry 13
CIDR: Longest prefix match Implicit ordering in the routing table longer prefixes higher up the table So, the first match is the right one Explicit route to directly attached host a netmask of 0.0.0.0 14
VLSM 15
VLSM Variable-length subnet mask Classful allows only one subnet in a network > one subnet in an autonomous system Maximizing the use of address (Subnet Zero) Subnetting a Subnet Routing Protocol that supports VLSM OSPF, Integrated IS-IS, EIGRP, RIPv2, and static routing 16
Subnet with VLSM 192.168.10.0/24 17
Regular Subnet 192.168.10.0/24 7 subnets; The largest subnet needs 60+1 hosts If 3 bits for subnet (8 subnets) 5 bits for host (32 hosts) If 6 bits for host (64 hosts) 2 bits for subnet (4 subnets) 18
Subnet with VLSM Select the biggest first 192.168.10.0/24 192.168.10.0/26 192.168.10.64/26 192.168.10.128/26 192.168.10.192/26 192.168.10.64/26 192.168.10.64/27 192.168.10.96/27 Perth KL 19
Subnet with VLSM 192.168.10.96/27 192.168.10.96/28 192.168.10.112/28 Sydney Singapore 192.168.10.128/26 192.168.10.128/30 192.168.10.132/30 192.168.10.136/30 192.168.10.140/30... Perth KL Sydney KL Singapore KL 20
Final: Subnet with VLSM 21
Example II 250 Stations 165.23. 1101 0000. 0000 0000 165.23.208.0/20 CPE IE EE 700 Stations 500 Stations 100 Stations 22
250 Stations Solution CPE IE EE 165.23.208.0/20 165.23.208.0/22 165.23.212.0/22 165.23.216.0/22 165.23.220.0/22 165.23.212.0/22 165.23.212.0/23 165.23.214.0/23 1022 Hosts 510 Hosts 700 Stations 500 Stations 100 Stations The largest subnet needs 701 hosts 10 bits for host (1024 hosts) 165.23.214.0/23 165.23.214.0/24 165.23.215.0/24 165.23.215.0/24 165.23.215.0/25 165.23.215.128/25 254 Hosts 126 Hosts 165.23.215.128/25 165.23.215.128/30 165.23.215.132/30 165.23.215.136/30 2 Hosts
Final Solution 165.23.214.0/24 250 Stations 165.23.208.0/20 CPE 165.23.215.128/30 IE 165.23.215.132/30 EE 700 Stations 500 Stations 100 Stations 165.23.208.0/22 165.23.212.0/23 165.23.215.0/25 24
Quiz 123.7.128.0/18 A 15 hosts B C D E 100 100 hosts hosts 80 hosts 550 hosts 30 100 hosts 25
Notes for CIDR CIDR was actually intended as a quick fix Solve addressing crisis until IPv6 was deployed Unfortunately, CIDR has been widely adopted IPv6 deployment has proven to be very, very slow CIDR is currently deployed However, IPv6 is not compatible with IPv4 Generates a big migration problem 26
Growth in Routing Table Size Pre-CIDR (1988-1994): Steep Growth Rate Jennifer Rexford, Internet Routing (COS 598A) 27
Growth in Routing Table Size CIDR Deployment (1994-1996): Much Flatter Jennifer Rexford, Internet Routing (COS 598A) 28
Autonomous System (AS) A single network domain Grouping of computers/routers Operate in isolation from other groups A single network administrative entity 29
Autonomous System (AS) Need protocols for distribute routing information in the AS Interior Gateway Protocols (IGPs) Intradomain routing algorithms Between AS Need interdomain routing algorithms Exterior Gateway Protocols (EGPs) More complex task 30
Autonomous System (AS) AS 5 AS 1 Autonomous System Boarder router (ASBR) Exterior Gateway Protocol (EGP Link) Interior Gateway Protocol (IGP Link) AS 20 AS 7 This is the Internet! 31
Types of AS Stub AS Only has a single connection to one other AS only carries local traffic Multihomed AS Connect to more than one other AS But will not carry transit traffic Transit AS Connect to more than one other AS Can carry both local and transi traffic 32
Transit vs. Nontransit AS Transit traffic = traffic whose source and destination are outside the AS Nontransit AS: does not carry transit traffic Advertise own routes only Do not propagate routes learned from other AS s Transit AS: does carry transit traffic Advertises its own routes PLUS routes learned from other AS s r1 ISP1 r3 ISP2 r1 ISP1 r3 ISP2 r2 r1 r3 r2 r2,r3 r1 r3 r2,r1 r2 AS1 r2 AS1 33